def outFun(num):
    # num = 10
    def innerFun():
        nonlocal num
        num = 20
        num2 = num + 20
        print(num2)

    print("num:", num)
    innerFun()
    print("num:", num)
    return innerFun


newFun = outFun(10)
newFun()
